package com.ht.modules.component.ai.session.entity;

import lombok.Builder;
import lombok.Data;

@Builder
@Data
public class SessionResponse {
    public static final String THINK_START_TAG = "<think>";
    public static final String THINK_END_TAG = "</think>";
    // 使用枚举来表示当前阶段，替代复杂的状态判断
    public enum ResponseStage {
        INITIAL, THINKING, POST_THINKING, REPLYING
    }
    private String message;
    private String type;
    /**
     * 结束
     */
    public static SessionResponse end() {
        return SessionResponse.builder()
                .message("")
                .type("end")
                .build();
    }

    /**
     * 思考
     */
    public static SessionResponse think(String message) {
        return SessionResponse.builder()
                .message(message)
                .type("think")
                .build();
    }

    /**
     * 回复
     */
    public static SessionResponse reply(String message) {
        return SessionResponse.builder()
                .message(message)
                .type("reply")
                .build();
    }

    /**
     * 错误
     */
    public static SessionResponse error(String message) {
        return SessionResponse.builder()
                .message(message)
                .type("error")
                .build();
    }
}
